<#include "macrosDisplay.ftl">
<#include "macrosLoops.ftl">
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>
	 <@boLoop>
	<!-- START <@boCap/> -->
	<managed-bean>
		<description>
			The <@boCap/>Handler handles all the access betweent he JSF UI and
			the underlying framework.
		</description>
		<managed-bean-name><@boLow/>Handler</managed-bean-name>
		<managed-bean-class>com.tps.gen.ui.<@boCap/>Handler</managed-bean-class>
		<managed-bean-scope>session</managed-bean-scope>
	</managed-bean>
	</@boLoop>
	
	<managed-bean>
		<description>Tree Handler</description>
		<managed-bean-name>treeHandler</managed-bean-name>
		<managed-bean-class>com.tps.framework.jsf.TreeHandler</managed-bean-class>
		<managed-bean-scope>session</managed-bean-scope>
		
		<managed-property>
			<property-name>treeNodeMapping</property-name>

			<map-entries>	
				<@TabsLoop>
				<@TabsEntityRefLoop tab>
				<map-entry>
					<key><@pluralize entity.displayName /></key>
					<value>${tab.name}</value>
				</map-entry>
				</@TabsEntityRefLoop>
				</@TabsLoop>
			</map-entries>
		</managed-property>
	
		<managed-property>
			<property-name>rootNodes</property-name>
			
			<map-entries>
			<@boLoop>
				<@isRoot>

				<map-entry>
					<key><@boDisplayPlural/></key>
					<value>com.tps.gen.bo.<@boCap/></value>
				</map-entry>
				</@isRoot>	
			</@boLoop>	
			</map-entries>
		</managed-property>
	</managed-bean>
	
	<!-- Navigation Rules For JSPs-->
	<@boLoop>
	<navigation-rule>
		<from-view-id>/secure/<@boLow/>.jsp</from-view-id>
		<navigation-case>
			<from-outcome>success</from-outcome>
			<to-view-id>/secure/<@boLow/>.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>
	</@boLoop>
	
	<!-- Navigation Rules -->
	<@boLoop>
	<navigation-rule>
		<navigation-case>
			<from-outcome>com.tps.gen.bo.<@boCap/></from-outcome>
			<to-view-id>/secure/<@boLow/>.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>
	</@boLoop>
	
</faces-config>
